Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation annotations improvements (Prototype). #7470

Open
wants to merge 4 commits into
base: dev/patch
Choose a base branch
from

Conversation

Moderocky
Copy link
Member

SOTU

The examples annotation format currently has three issues:

  1. It doesn't differentiate between two separate examples and one example with multiple lines.
  2. It's a bit annoying to escape characters (quotes, tabs, etc.) and these don't always display as expected in the html.
  3. There are some inconsistencies in their formatting.

For example, around 40% of the multi-line examples are currently indented.
image
The rest are not.
image

I, personally, dislike this practice because it's not really in line with the code style and it's likely to be erased by auto-reformatting. That said, I understand why it's currently done for clarity.

The New Proposal

  1. Each example gets its own annotation.
  2. Each example is contained in one string. Multi-line examples can use Java 17's multi-line strings.
  3. Formatting characters (quotes, whitespace, etc.) do not need to be escaped in this mode.
  4. Possibly, include a flag for whether an example is just lines of code, or of an entire structure at the file root. Docs sites may want to display these differently in some way. (non-essential)

Side-by-Side

The current format:
image

The new (proposed) format:
image

@Moderocky Moderocky added the housekeeping Housekeeping-related issue or task. label Jan 18, 2025
@Efnilite Efnilite added enhancement Feature request, an issue about something that could be improved, or a PR improving something. documentation Related to Skript's official documentation. labels Jan 19, 2025
@Moderocky Moderocky marked this pull request as ready for review January 23, 2025 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to Skript's official documentation. enhancement Feature request, an issue about something that could be improved, or a PR improving something. housekeeping Housekeeping-related issue or task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants